import xadmin

from apps.organizations.models import Teacher, CourseRrg, City

class TeacherAdmin(object):
    list_display = ["org", "name", "work_year", "work_company"]

    serach_fields = ["org", "name", "work_year", "work_company"]

    list_filter = ["org", "name", "work_year", "work_company"]

class CourseRrgAdmin(object):
    list_display = ["name", "desc", "click_nums", "fav_nums"]

    serach_fields = ["name", "desc", "click_nums", "fav_nums"]

    list_filter = ["name", "desc", "click_nums", "fav_nums"]

class CityAdmin(object):
    #显示列
    list_display = ["id", "name", "desc"]
    #搜索列
    serach_fields = ["name", "desc"]
    #过滤
    list_filter = ["name", "desc", "add_time"]
    #编辑
    list_editable = ["name", "desc"]
xadmin.site.register(Teacher, TeacherAdmin)
xadmin.site.register(CourseRrg, CourseRrgAdmin)
xadmin.site.register(City, CityAdmin)